#!/bin/sh

cd ../powerbank/
pwd
if [ "$1"=="app" ];then
	make package/powerbank/clean V=s
	make package/powerbank/prepare V=s
	make package/powerbank/compile V=s
	make package/powerbank/install V=s
fi
cd -
cp ../powerbank/bin/ramips/packages/base/powerbank_1_ramips_24kec.ipk ./
cp ../powerbank/bin/ramips/openwrt-ramips-mt7628-powerbank-squashfs-sysupgrade.bin ./openwrt-ramips-mt7628-powerbank-squashfs-sysupgrade.bin
md5sum openwrt-ramips-mt7628-powerbank-squashfs-sysupgrade.bin  |awk '{print $1}' |tr -d "'\n' " > md5
git add powerbank_1_ramips_24kec.ipk
git add openwrt-ramips-mt7628-powerbank-squashfs-sysupgrade.bin
git add md5
git commit -m "update"
git push
